import Vue from 'vue'
import VueRouter from 'vue-router'
import StudentView from "@/views/StudentView";
import MainView from "@/views/MainView";
import EmployeeView from "@/views/EmployeeView";

Vue.use(VueRouter)

//路由规则
const routes = [
  {
    path: '/',
    name: 'main',
    component: MainView,
    children:[  //子页面
      {
        path: '/student',
        name: 'student',
        component: StudentView
      },
      {
        path: '/employee',
        name: 'employee',
        component: EmployeeView
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
